<?php
class Views_Helpers_ShowNews extends Zend_View_Helper_Abstract{
        public $view;
        public function setView(Zend_View_Interface $view){
            $this->view = $view;
        }

	public function showNews(){
            $str = '';
            $news = $this->view->news;
            foreach($news as $onenews){
                $str .= '
                    <div class="creammagShortNewsPost">
                        <img alt="" src="' . $onenews->getPhoto() . '" />
                        <div class="creammagShortNewsPostBonus">' . $onenews->getRating() . '</div>
                        <h2 class="clear">' . $onenews->getName() . '</h2>
                        <a href="' . $onenews->getUrl() . '" class="creamShortNews" style="text-align: left;">' . $onenews->getDescription() . '&gt;&gt;</a>
                        <div class="creammagdots" style="height: 5px;"></div>
                        <div><a href="' . $onenews->getProfileUrl() . '" class="localauthor"><span class="pen"></span><span class="newsauthor">' . $onenews->getProfileName() . '</span></a><a href="#" class="localcomments"><span class="comment"></span><span class="newsauthor">' . $onenews->getComments() . '</span></a></div>
                    </div>
                    ';
            }
            $shortNews = $this->view->shortNews;
            $shortStr = '';
            foreach($shortNews as $onenews){
                $shortStr .= '
                    <div>
                        <p class="creammagPShort">&gt;&nbsp;
                        <a href="' . $onenews->getProfileUrl() . '" class="localauthorshort">' . $onenews->getProfileName() . '</a>
                            &nbsp;|&nbsp; ' . $onenews->getText() . '</p></div>
                    ';
            }

            $tagsStr = '';
            $tags = $this->view->tags;
            foreach($tags as $onetagid => $onetagname){
                $tagsStr .= '
                    <li><a href="' . $onetagid . '" class="localnavigation">' . $onetagname['key'] . '</a></li>
                    ';
                
            }

        $html = '
                <div class="creammagshowNewLeft">
                    <ul>
                        <li style="margin-left:-10px;"><span class="left_local_pica"></span><a href="#" class="localnavigationmain center_local_pica">новости</a><span class="right_local_pica"></span></li>
                        <li class="clear"></li>
                        <li ><a href="#" class="localnavigationmain">показать все</a></li>
                    </ul>
                    <div class="creammagdots" style="height: 20px;"></div>
                    <ul>
                        ' . $tagsStr . '
                    </ul>
                </div>
                <div class="creammagshowNewCenter">

                ' . $str . '



                </div>
                <div class="creammagshowNewRight">
                    <div class="creamLeftTopShortNewsLine"></div>
                    <div class="creamCenterTopShortNewsLine"></div>
                    <div class="creamRightTopShortNewsLine"></div>
                    
                    <div class="clear creamCenterContentShortNewsLine">
                    <h2 class="creammagh2">короткие новости:</h2>
                    <div class="creammagdotswhite" style="height: 20px;"></div>
                    ' . $shortStr . '
                    </div>
                    
                    <div class="creamLeftBottomShortNewsLine"></div>
                    <div class="creamCenterBottomShortNewsLine"></div>
                    <div class="creamRightBottomShortNewsLine"></div>
                    
                    <div class="clear"></div>
                </div>
                <div class="clear"></div>
                ';
            return $html;
	}
}